<?php

namespace App\Admin;

use Illuminate\Database\Eloquent\Model;

class Single extends Model
{
    //表名
    protected $table = 'single';
    //关闭时间戳
    public $timestamps = false;
    //插入数据库设置白名单
    protected $fillable =['name','categoods_id','describe','visitor','recommend','disstatus','time','pic'];
    //定义关系到点赞表
    public function zans(){
        return $this->hasMany('App\Admin\Zan');
    }
    //定义关系到收藏表
    public function collects(){
        return $this->hasMany('App\Admin\Collect');
    }
}
